package top.layne.cloud.tsf.msgw.zuul.filter;

import com.netflix.zuul.exception.ZuulException;
import com.tencent.tsf.gateway.core.annotation.TsfGatewayFilter;
import com.tencent.tsf.gateway.zuul1.filter.TsfGatewayZuulFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.PRE_TYPE;

/**
 * @author : layne
 * @Date: 2020/7/24
 * @Time: 17:25
 * Description:
 */
@TsfGatewayFilter
public class MsgwZuulFilter extends TsfGatewayZuulFilter {

    private static final Logger LOGGER = LoggerFactory.getLogger(MsgwZuulFilter.class);

    @Override
    public String filterType() {
        return PRE_TYPE;
    }

    @Override
    public int filterOrder() {
        return 0;
    }

    @Override
    public boolean shouldFilter() {
        return true;
    }

    @Override
    public Object run() throws ZuulException {
        System.out.println(">>>>>zuul gateway enter ");
        LOGGER.info(">>>>>zuul gateway enter ");
        return null;
    }
}
